<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="root">

    </div>
</body>
<script src="../react.js"></script>
<script src="../react-dom.js"></script>
<script src="https://cdn.staticfile.org/babel-standalone/6.26.0/babel.min.js"></script>
<script type="text/babel">

    class App extends React.Component{
        state={
            num:0
        }
        render(){
            console.log(this)
            return(
                <div>
                    <h1>{this.state.num}</h1>
                    <button onClick={()=>{
                        this.state.num++;
                        this.setState({
                            num:this.state.num
                        })
                    }}>绑定事件</button>    
                    <button onClick={this.addNum}>绑定事件2</button>
                    <button onClick={()=>this.addNum(this.state.num)}>绑定事件传递参数</button>
                </div>
            )
        }
        addNum(num){
            alert(1234567)
            alert(num)
        }
        remove(){
            console.log("12312321")
        }
    }

    ReactDOM.render(<App/>,document.getElementById("root"))
</script>
</html>